home *** CD-ROM | disk | FTP | other *** search
- #ifndef GAMES_GMS_H
- #define GAMES_GMS_H TRUE
-
- /*
- ** $VER: games.h 0.2 (05.7.96)
- ** Includes Release xx.xx
- **
- ** General include file for programs using the Games Master System.
- **
- ** (C) Copyright 1996 DreamWorld Productions.
- ** All Rights Reserved
- */
-
- #ifndef EXEC_TYPES_H
- #include <exec/types.h>
- #endif
-
- #define FILTER_OFF 0
- #define FILTER_ON 1
-
- /*
- ** --- Universal joystick status bits returned from Read_Joystick, Sega,
- ** JoyPad, etc...
- */
-
- #define JS_LEFT (1L<<0) /* X axis */
- #define JS_RIGHT (1L<<1)
- #define JS_UP (1L<<2) /* Y axis */
- #define JS_DOWN (1L<<3)
- #define JS_ZIN (1L<<4) /* Z axis! Reserved for later... */
- #define JS_ZOUT (1L<<5)
- #define JS_FIRE1 (1L<<6) /* Fire Buttons */
- #define JS_FIRE2 (1L<<7) /* <-For 2 button joysticks */
-
- #define JS_RED (1L<<6)
- #define JS_BLUE (1L<<7)
- #define JS_PLAY (1L<<8) /* CD32 buttons here */
- #define JS_RWD (1L<<9)
- #define JS_FFW (1L<<10)
- #define JS_GREEN (1L<<11)
- #define JS_YELLOW (1L<<12)
-
- #define JB_FIRE1 (1L<<16) /* For the ZBXY style return type */
- #define JB_FIRE2 {1L<<17) /* (analog joysticks) */
-
- #define M_LMB (1L<<0)
- #define M_RMB (1L<<1)
- #define M_MMB (1L<<2)
-
- /* --- Joyport specifications for calling Read_JoyStick/Mouse/JoyPad...() */
-
- #define JPORT1 0*2
- #define JPORT2 1*2
- #define JPORT3 2*2
- #define JPORT4 3*2
-
- /* --- Raster/Copper commands for RasterLists. */
-
- #define COL12Len 10 /* COL12,Line,Colour,RGB */
- #define COL12LISTLen 16 /* COL12LIST,Line,Skip,Colour,RGB */
- #define COL24LISTLen 16 /* COL24LIST,Line,Skip,Colour,RRGGBB */
- #define COL24Len 12 /* COL24,Line,Colour,RRGGBB */
- #define SPRITELen 10 /* SPRITE,Line,SpriteStruct */
- #define SCROLLLen 8 /* SCROLL,Line,Offset */
- #define FSCROLLLen 10 /* FSCROLL,Line,Offset */
- #define FLOODLen 6 /* FLOOD,Line */
- #define REPOINTLen 10 /* REPOINT,Line,BitPtr */
- #define MIRRORLen 6 /* MIRROR,Line */
- #define NEWPALETTELen 14 /* NEWPALETTE,Line,ColStart,AmtCols,Palette */
- #define WAITLINELen 8
-
- #define COL12 0
- #define COL24 1
- #define COL12LIST 2
- #define COL24LIST 3
- #define SPRITE 4
- #define SCROLL 5
- #define FSCROLL 6
- #define FLOOD 7
- #define REPOINT 8
- #define MIRROR 9
- #define NEWPALETTE 10
- #define WAITLINE 11
- #define RASTEND -1
-
- /* --- GPI ID numbers. */
-
- #define GPI_SCREENS 0
- #define GPI_BLITTER 1
- #define GPI_SOUND 2
- #define GPI_NETWORK 3
- #define GPI_VECTORS 4
- #define GPI_DEBUG 5
-
- /* --- Standard screen structure. */
-
- struct GameScreen
- {
- char SS_VERSION[4]; /* Structure version - "GSV1" */
- APTR SS_MemPtr1; /* Ptr to screen 1 */
- APTR SS_MemPtr2; /* Ptr to screen 2 (if buffered) */
- APTR SS_MemPtr3; /* Ptr to screen 3 (triple buffer!!) */
- APTR SS_ScreenLink; /* Ptr to a linked screen */
- APTR SS_Palette; /* Ptr to the screen palette */
- APTR SS_RasterList; /* Ptr to a rasterlist */
- ULONG SS_AmtColours; /* The amount of colours in the palette. */
- UWORD SS_Scr_Height; /* The height of the visible screen */
- UWORD SS_Scr_Width; /* The width of the visible screen */
- UWORD SS_Scr_ByteWidth; /* Width of the screen in _bytes_ */
- UWORD SS_Pic_Height; /* The height of the entire screen */
- UWORD SS_Pic_Width; /* The width of the entire screen */
- UWORD SS_Pic_ByteWidth; /* Width of the entire screen, bytes */
- UWORD SS_Planes; /* The amount of planes in da screen */
- WORD SS_TopOfScrX; /* Hardware co-ordinate for TOS */
- WORD SS_TopOfScrY; /* Hardware co-ordinate for LOS */
- UWORD SS_ScrollBuffer; /* Scroll buffer in pixels */
- WORD SS_ScrollXCount; /* Offset of the horizontal axis */
- WORD SS_ScrollYCount; /* Offset of the vertical axis */
- ULONG SS_ScrAttrib; /* Special Attributes are? */
- UWORD SS_ScrMode; /* What screen mode is it? */
- UBYTE SS_ScrType; /* Interleaved or Sequential? */
- UBYTE SS_Displayed; /* Am I currently displayed? */
- APTR SS_Extended; /* Private */
- APTR SS_ScreenStats; /* Private */
- };
-
- #define INTERLEAVED 0 /* These are actual numbers */
- #define PLANAR 1 /* rather than bits */
- #define CHUNKY 2
- /* SCREEN ATTRIBUTES */
- #define DBLBUFFER 0x00000001 /* For double buffering */
- #define TPLBUFFER 0x00000002 /* Triple buffering!! */
- #define PLAYFIELD 0x00000004 /* Set if it's part of a playfield */
- #define HSCROLL 0x00000008 /* Gotta set this to do scrolling */
- #define VSCROLL 0x00000010 /* For vertical scrolling */
- #define SPRITES 0x00000020 /* Set this if you want sprites */
- /* 0x00000040 */
- #define NOBURST 0x00000080 /* This forces burst mode to off */
- #define BLKBDR 0x00000100 /* Gives a blackborder on AGA machines */
- #define NOSPRBDR 0x00000200 /* For putting sprites in the border */
- /* 0x00000400 */
- #define SPR32 0x00000800 /* Set one of these if you will */
- #define SPR64 0x00001000 /* be using sprites larger than 16X */
-
- /* SCREEN MODES */
- #define LORES 0x0000 /* Low resolution (default) */
- #define HIRES 0x0001 /* High resolution */
- #define SHIRES 0x0002 /* Super-High resolution */
- #define INTERLACED 0x0004 /* Interlaced */
- #define NTSC 0x0020 /* Set if you wrote this game in NTSC */
- #define HAM 0x0040 /* For HAM mode */
- #define _24BITCOL 0x0080 /* 24Bit colours (default is 12Bits) */
-
- /* --- Universal errorcodes returned by certain functions --- */
-
- #define ERR_OK 0 /* Function went OK (also NULL) */
- #define ERR_NOMEM 1 /* Not enough memory available */
- #define ERR_NOPTR 2 /* Relevant ptr not present */
- #define ERR_INUSE 3 /* Previous allocations have not been freed */
- #define ERR_NOVER 4 /* Structure version not supported/not found */
-
- /* --- Sprite structure --- */
-
- struct SpriteStruct
- {
- UWORD SPR_Number;
- APTR SPR_Address; /* Pointer to Sprite graphic */
- WORD SPR_XPos;
- WORD SPR_YPos;
- UWORD SPR_Frame;
- UWORD SPR_Width;
- UWORD SPR_Height;
- UWORD SPR_AmtColours; /* 4/16 */
- UWORD SPR_ColStart;
- UWORD SPR_Planes;
- UWORD SPR_Resolution; /* HiRes/LoRes/SHiRes/XLONG */
-
- ULONG SPR_SpriteSize; /* Must be initialized */
- ULONG SPR_FrameSize; /* Must be initialized */
- };
-
- #define SPR_OCS 0x0010
- #define SPR_AGA 0x0020
- #define XLONG 0x0040
-
-
- /* --- BOB structure */
-
- struct BOBStruct
- {
- UWORD BOB_Frame; /* Current frame */
- APTR BOB_Frame_List; /* Pointer to frame list */
- WORD BOB_XPos; /* X position */
- WORD BOB_YPos; /* Y position */
- UWORD BOB_Height; /* Height */
- UWORD BOB_ByteWidth; /* Width in bytes */
- WORD BOB_ClipLeft; /* "Clip Area" border restrictions */
- WORD BOB_ClipTop;
- WORD BOB_ClipRight;
- WORD BOB_ClipBottom;
- UWORD BOB_Attributes; /* Mask/Chunky/Planar/Interleaved */
- UWORD BOB_Amt_Planes; /* Amt of planes */
- UWORD BOB_First_Plane; /* Planar only */
- UWORD BOB_Draw_Method;
- UWORD BOB_BackGrnd_Info; /* Is a background stored? */
- APTR BOB_BackGrnd_Ptr; /* Where is the background stored? */
-
- APTR FB_Draw_Routine; /* Private stuff here! */
- APTR FB_Clear_Routine; /* Don't ever touch this stuff! */
- ULONG FB_BlitSize;
- ULONG FB_Modulo1;
- ULONG FB_Modulo2;
- UWORD FB_LineSize;
- UWORD FB_BotCut;
- UWORD FB_TBWidth;
- WORD FB_Reserved;
- };
-
- /* --- BOB Drawing Methods */
-
- #define INTLV_NCNM 00 /* No clip, no mask */
- #define INTLV_NCYM 01 /* No clip, masked */
- #define INTLV_YCNM 02 /* Clip, no mask */
- #define INTLV_YCYM 03 /* Clip, masked */
-
- /* PLANAR */
- #define PLNR_NCNM 04
- #define PLNR_NCYM 05
- #define PLNR_YCNM 06
- #define PLNR_YCYM 07
-
- /* CHUNKY */
- #define CHNKY_NCNM 08
- #define CHNKY_NCYM 09
- #define CHNKY_YCNM 10
- #define CHNKY_YCYM 11
-
- /* --- Sound stuff */
-
- #define CHAN_FREE 0 /* For Check_Channel() */
-
- #define CHANNEL_ALL -1
- #define CHANNEL_1 0
- #define CHANNEL_2 1
- #define CHANNEL_3 2
- #define CHANNEL_4 3
-
- #define RAW 0
- #define IFF 1
- #define WAV 2
-
- struct SoundStruct
- {
- WORD SAM_Type; /* IFF/WAV/RAW/ */
- WORD SAM_Channel; /* Channel, 0-3 */
- WORD SAM_Priority; /* Priority, 0-127 */
- LONG SAM_Address; /* Address of sample data */
- WORD SAM_Length; /* Length of sample data in WORDS */
- WORD SAM_Period; /* Speed of playback */
- WORD SAM_Volume; /* Volume of sample */
- };
-
- /* --- Choose one of these for calling Set_Interrupt() --- */
-
- #define INTB_INTEN 14 /* Master interrupt (enable only ) */
- #define INTB_EXTER 13 /* External interrupt */
- #define INTB_DSKSYNC 12 /* Disk re-SYNChronized */
- #define INTB_RBF 11 /* serial port Receive Buffer Full */
- #define INTB_AUD3 10 /* Audio channel 3 block finished */
- #define INTB_AUD2 9 /* Audio channel 2 block finished */
- #define INTB_AUD1 8 /* Audio channel 1 block finished */
- #define INTB_AUD0 7 /* Audio channel 0 block finished */
- #define INTB_BLIT 6 /* Blitter finished */
- #define INTB_VERTB 5 /* start of Vertical Blank */
- #define INTB_COPER 4 /* Coprocessor */
- #define INTB_PORTS 3 /* I/O Ports and timers */
- #define INTB_SOFTINT 2 /* software interrupt rest */
- #define INTB_DSKBLK 1 /* Disk Block done */
- #define INTB_TBE 0 /* serial port Transmit Buffer Empty */
-
- /* --- Special Keypresses that can be returned from Read_Key(). All other
- ** keys can be considered to be in ASCII format.
- */
-
- struct KeyStruct
- {
- WORD KP_ID;
- BYTE KP_Qualifier;
- BYTE KP_Key;
- BYTE KP_PQualifier; /* Older keys */
- BYTE KP_PKey;
- };
-
- #define K_BAKSPC 0x80
- #define K_DEL 0x81
- #define K_HELP 0x82
-
- #define K_LSHIFT 0x83
- #define K_RSHIFT 0x84
- #define K_CAPS 0x85
- #define K_CTRL 0x86
- #define K_LALT 0x87
- #define K_RALT 0x88
- #define K_LAMIGA 0x89
- #define K_RAMIGA 0x8a
-
- #define K_F1 0x8b
- #define K_F2 0x8c
- #define K_F3 0x8d
- #define K_F4 0x8e
- #define K_F5 0x8f
- #define K_F6 0x90
- #define K_F7 0x91
- #define K_F8 0x92
- #define K_F9 0x93
- #define K_F10 0x94
- #define K_F11 0x95
- #define K_F12 0x96
- #define K_F13 0x97
- #define K_F14 0x98
- #define K_F15 0x99
- #define K_F16 0x9a
- #define K_F17 0x9b
- #define K_F18 0x9c
- #define K_F19 0x9d
- #define K_F20 0x9e
-
- #define C_UP 0x9f
- #define C_DOWN 0xa0
- #define C_RIGHT 0xa1
- #define C_LEFT 0xa2
-
- #define K_SRIGHT 0xa3 /* Special key on right */
- #define K_SLEFT 0xa4 /* Special key on left */
-
- /* --- Special keys that are recognised under ASCII (here for convenience)*/
-
- #define K_ENTER 10
- #define K_RETURN 10
- #define K_TAB 09
- #define K_ESC ""
-
- #endif
-